<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class TRealdataGenerator extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('t_realdata_Generator', function (Blueprint $table) {
             $table->engine = 'MEMORY';
             $table->charset = 'utf8';
             $table->collation = 'utf8_general_ci';
            // CONTENT
            $table->datetime('rd_updatetime')->nullable()->default(null)->comment('');
			$table->unsignedInteger('pdi_index')->nullable(false)->default(0)->comment('');
			$table->float('rd_EleUab', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_EleUbc', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_EleUac', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_EleUa', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_EleUb', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_EleUc', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_GenUab', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_GenUbc', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_GenUac', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_GenUa', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_GenUb', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_GenUc', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_EleIa', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_EleIb', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_EleIc', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_PowFac', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_WatTemp', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_OilPre', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_FueLev', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_BatVol', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_CharVol', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_EleFre', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_GenFre', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_ActPow_A', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_ActPow_B', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_ActPow_C', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_ActPow_All', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_ReaPow_A', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_ReaPow_B', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_ReaPow_C', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_ReaPow_All', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_AppPow_A', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_AppPow_B', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_AppPow_C', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_AppPow_All', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_EngSpeed', 9, 2)->nullable()->default(0)->comment('');
			$table->boolean('rd_PubAlarm')->nullable()->default(0)->comment('');
			$table->boolean('rd_PubOutageAlarm')->nullable()->default(0)->comment('');
			$table->boolean('rd_PubWarnAlarm')->nullable()->default(0)->comment('');
			$table->boolean('rd_PubEleAlarm')->nullable()->default(0)->comment('');
			$table->boolean('rd_EmerShut')->nullable()->default(0)->comment('');
			$table->boolean('rd_HighWaterTemp')->nullable()->default(0)->comment('');
			$table->boolean('rd_LowOilPre')->nullable()->default(0)->comment('');
			$table->boolean('rd_OveGen')->nullable()->default(0)->comment('');
			$table->boolean('rd_UnderSpeedGen')->nullable()->default(0)->comment('');
			$table->boolean('rd_LosVelSig')->nullable()->default(0)->comment('');
			$table->boolean('rd_OverFre')->nullable()->default(0)->comment('');
			$table->boolean('rd_UnderFre')->nullable()->default(0)->comment('');
			$table->boolean('rd_OverVol')->nullable()->default(0)->comment('');
			$table->boolean('rd_UnderVol')->nullable()->default(0)->comment('');
			$table->boolean('rd_OverCur')->nullable()->default(0)->comment('');
			$table->boolean('rd_StaFail')->nullable()->default(0)->comment('');
			$table->boolean('rd_OilPreSenOpen')->nullable()->default(0)->comment('');
			$table->boolean('rd_InputPortShut')->nullable()->default(0)->comment('');
			$table->boolean('rd_OverCurTrip')->nullable()->default(0)->comment('');
			$table->boolean('rd_EleTripInPort')->nullable()->default(0)->comment('');
			$table->boolean('rd_DownFaill')->nullable()->default(0)->comment('');
			$table->boolean('rd_LowFuelLev')->nullable()->default(0)->comment('');
			$table->boolean('rd_ChaFai')->nullable()->default(0)->comment('');
			$table->boolean('rd_BatUnderVol')->nullable()->default(0)->comment('');
			$table->boolean('rd_BatOverVol')->nullable()->default(0)->comment('');
			$table->boolean('rd_InputWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_EleAbno')->nullable()->default(0)->comment('');
			$table->boolean('rd_GenAbno')->nullable()->default(0)->comment('');
			$table->boolean('rd_CommSta')->nullable()->default(0)->comment('');
			$table->boolean('rd_NetCom')->nullable()->default(0)->comment('');
			$table->unique('pdi_index', 'pdi_index');
			
        });

        
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('t_realdata_Generator');
    }
}
